# Maintainer: Sven-Hendrik Haase <svenstaro@archlinux.org>
# Collaborator: Jonathan Fine (were.Vire AT gmail DOT com)
pkgname=tiled
pkgver=1.10.2
pkgrel=1
pkgdesc='A general purpose tile map editor, built to be flexible and easy to use'
arch=('loong64' 'x86_64')
url='http://www.mapeditor.org'
license=('GPL')
depends=('qt6-base' 'libgl' 'gtk-update-icon-cache' 'shared-mime-info' 'desktop-file-utils' 'libxkbcommon-x11'
         'qt6-declarative' 'qt6-quickcontrols2' 'qt6-svg' 'zstd')
makedepends=('mesa' 'qt6-tools' 'python' 'qbs')
optdepends=('python: Python plugin'
            'qt6-imageformats: Support for additional image formats (including WebP)')
source=($pkgname-$pkgver.tar.gz::https://github.com/mapeditor/tiled/archive/v${pkgver}.tar.gz)
sha512sums=('963ea9bc15bfdb3b18363888e7e3cb964895a6f4919f93ab1c4ce679ed979bd9640115c1d76d3b597390afd0630342313cbb8308d26ddd66226ce99dfc8cd7e7')

prepare() {
  qbs setup-qt /usr/bin/qmake6 qt6
  qbs config defaultProfile qt6
}

build() {
  cd $pkgname-$pkgver
  qbs config:release qbs.installPrefix:"/usr" projects.Tiled.useRPaths:false projects.Tiled.installHeaders:true
}

package() {
  cd $pkgname-$pkgver
  qbs install config:release --install-root "$pkgdir"
}
